package util;

import java.sql.DriverManager;

import com.mysql.jdbc.Connection;

import exceptions.ExceptionSql;

public class ConnectionFactory {

	private String driver = "com.mysql.jdbc.Driver";
	/*
	private String user = "root";
	private String password = "";
	private String host = "localhost";
	private String banco = "araujo_seguros";
	*/
	private String user = "tecksoft_root";
	private String password = "teckpr106+mp056";
	private String host = "br-4.srvhost.com.br";
	private String banco = "tecksoft_araujo_seguros_v2";
	
	
	
	// ----------------------------------------------------------------------------
	public Connection getConnection() {

		String url = "jdbc:mysql://"+host+"/"+banco+"";

		try {
			Class.forName(driver);
			return (Connection) DriverManager.getConnection(url, user, password);
		} catch (Exception e) {
			new ExceptionSql();
		}
		return null;
	}
	//----------------------------------------------------------------------------
}